#!/bin/bash

wget -c https://storage.googleapis.com/harbor-releases/release-1.8.0/harbor-online-installer-v1.8.0.tgz
tar xvf harbor-online-installer-v1.8.0.tgz -C /data
cd /data/harbor

local_ip=$(nmcli device show eth0 | grep 'IP4.ADDRESS\[1\]:' | awk '{print $NF}' | cut -d '/' -f1)
sed -i 's#hostname:.*#hostname: harbor.local#' harbor.yml
sed -i "s#hostname:.*#hostname: $local_ip#" harbor.yml
sed -i 's#harbor_admin_password:.*#harbor_admin_password: admin#' harbor.yml
sed -i "1a\  \"insecure-registries\": [\"$local_ip\"]," /etc/docker/daemon.json

systemctl restart docker
systemctl restart docker

./install.sh    # --with-clair

